import React, { Component } from 'react';
import {HashRouter as Router, Route, Switch, Redirect} from 'react-router-dom'
import Index from  './index/Index'
import Cart from './cart/Cart'
import My from './my/My'
import Category from './category/Category'
import Tabbar from './tabbar/Tabbar'
import SearchCenter from './index/searchCenter/SearchCenter'
import GoodDetail from './goodDetail/GoodDetail'
import GoodList from './goodList/GoodList'
import Pay from './pay/Pay'
import Login from './login/Login'
import Fail from './404/Fail'
class RouterConfig extends Component {
    render() {
        return (
            <Router>
                <Route path="/" exact render={()=><Tabbar><Index></Index></Tabbar>}></Route>
                <Route path="/cart" exact render={(props)=><Tabbar><Cart {...props}></Cart></Tabbar>}></Route>
                <Route path="/my" exact render={(props)=><Tabbar><My {...props}></My></Tabbar>}></Route>
                <Route path="/category" exact render={()=><Tabbar><Category></Category></Tabbar>}></Route>
                <Route path="/searchCenter" exact render={()=><Tabbar><SearchCenter></SearchCenter></Tabbar>}></Route>
                <Route path="/goodDetail/:good_id" exact render={(props)=><Tabbar><GoodDetail {...props}></GoodDetail></Tabbar>}></Route>
                <Route path="/goodList" exact render={(props)=><Tabbar><GoodList {...props}></GoodList></Tabbar>}></Route>
                <Route path="/pay" exact render={(props)=><Pay {...props}></Pay>}></Route>
                <Route path="/login" exact render={(props)=><Login {...props}></Login>}></Route>
                {/* <Route path="/404" exact render={(props)=><Fail {...props}></Fail>}></Route>
                <Redirect to="/404"></Redirect> */}
            </Router>
        );
    }
}

export default RouterConfig;
